<template>
  <div>
    <router-link to="/one" tag="button">One</router-link>
    <router-link to="/two" tag="button">Two</router-link>
    <transition name="home">
      <router-view></router-view>
    </transition>
  </div>
</template>

<script>
export default {
  name: "App",
};
</script>

<style scoped>
.home-enter,
.home-leave-to {
  opacity: 0;
  transform: rotate(-30deg);
}

.home-enter-active,
.home-leave-active {
  transition: all 1s;
}

/* 控制消失的元素不占用空间 */
.home-leave-active {
  position: absolute;
}
</style>
